package com.zmx.job.execute.handler;

import com.zmx.core.handler.annotation.MallJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Description:
 * @ClassName: TestJob
 * @Author zhaomxr
 * @Date 2021-12-20 10:14
 */
@Slf4j
@Component
public class TestJob {

    @MallJob(value = "testJob")
    public void testJob() throws InterruptedException {
        int max = 0;
        while (max < 10){
            Thread.sleep(5000);
            log.info("testJob");
            log.info("testJob");
            log.info("testJob");
            log.info("testJob");
            log.info("testJob");
            max ++;
        }
    }

    @MallJob(value = "testJob1")
    public void testJob1() throws InterruptedException {
        while (true){
            Thread.sleep(3000);
            System.out.println("testJob1");
        }
    }
}
